POV-Ray : Newsgroups : povray.general : unexpected rotation result : Re: unexpected rotation result Server Time
8 Aug 2024 14:20:25 EDT (-0400)
  Re: unexpected rotation result  
From: Scott Hill
Date: 6 Feb 2001 07:02:19
Message: <3a7fe7cb@news.povray.org>
"David Fontaine" <dav### [at] faricynet> wrote in message
news:3A7F3285.CAAFC1FA@faricy.net...
> Scott Hill wrote:
>
> >     Most experienced programmers/scripters do - it's the safest way to
get
> > any language to do what _you want_, rather than what _it thinks you
want_ !
> > E.g, what does 1+2*3-4 evaluate to ?
>
> 3.

    No ! 5.

> Bad example, that's standard basic math. Everyone learns order of
operations
> in elementary school! :) In fact, even with all the computer-specific
> extensions like bit rotation and boolean logic, the order of precedence
should
> still be the same in every language.
>

    That's the point - we and parsers all assume, because we've all learned
(or, in the case of parsers, have been hard coded with) the correct operator
ordering, that it evaluates to 3, but, I may not have meant that, I could
just as easily meant ((1+2)*3)-4 ! Without brackets it is ambiguous, to a
degree - we may default to assuming that we're meant to follow the standard
operator order rules but we don't and can't know that that assumption is
correct.

Scott.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.